
/****** Object:  StoredProcedure [dbo].[web_ins_upd_protocol]    Script Date: 10/19/2013 09:20:36 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'web_ins_upd_protocol')
DROP PROCEDURE web_ins_upd_protocol
GO

-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[web_ins_upd_protocol]
	@N08_c_kodas_ks char(12),
	@N08_c_protokolas varchar(14),
	@N08_c_protokolas_p varchar(14)
AS
BEGIN
	SET NOCOUNT ON
	

	If exists(SELECT * FROM n08_klij_c where N08_c_kodas_ks = @N08_c_kodas_ks)
		update n08_klij_c set N08_c_protokolas = CAST(@N08_c_protokolas as numeric(12,3)),N08_c_protokolas_n = CAST(@N08_c_protokolas_p as numeric(12,3)) where N08_c_kodas_ks = @N08_c_kodas_ks
	else
		insert INto n08_klij_c ([N08_c_kodas_ks]
	   ,[N08_c_protokolas],[N08_c_protokolas_n]) values (@N08_c_kodas_ks,CAST(@N08_c_protokolas as numeric(12,3)),CAST(@N08_c_protokolas_p as numeric(12,3)))

    
END

GO



